<?php
namespace  v1;

class MyWinning extends \ResourceClass{
    public $isActive = true;
    public $remark = '我的奖品';

    public function get(array $req, array $post, &$result)
    {
        if (!isset($req['uid'])) {
            return 'uid不能为空';
        }
        $checkRes = $this->autoCheck($req['uid']);
        if($checkRes['code'] !== 200){
            return $checkRes['message'];
        }
        try {
            $size = isset($req['l']) ? $req['l'] : 6;
            $offset = isset($req['o']) ? $req['o'] : 0 ;
            $winning_orm = new \Orm\WinningLog\WinningLogModel();
            $winning_list = $winning_orm->getWinningListByUserId($req['uid'],$offset,$size);
            $result = $winning_list;
        }catch (\Exception $e) {
            $result = array();
        }
    }
}